import request from "../utils/request";
// 获取最近交易
export function gettransaction(pageIndex, pageSize) {
    return request({
        url: "/v1/getTxLast20",
        method: "get",
        params: {
            pageIndex: pageIndex,
            pageSize: pageSize
        }
    });
}
// 获取最近区块信息
export function block() {
    return request({
        url: "/v1/getBlockLast20",
        method: "get",
    });
}
//  根据区块号获取区块信息
export function getBlockByNumber(blockNumber) {
    return request({
        url: `/v1/getBlockByNumber?blockNumber=${blockNumber}`,
        method: "get",
    });
}
// 根据hash获取区块信息
export function getTxByHash(txHash) {
    return request({
        url: `/v1/getTxByHash?txHash=${txHash}`,
        method: "get",
    });
}
// 根据地址获取区块信息
export function getTxByAddress(address, pageIndex, pageSize) {
    return request({
        url: `/v1/getTxByAddress`,
        method: "get",
        params: {
            address: address,
            pageIndex: pageIndex,
            pageSize: pageSize
        }
    });
}
// 根据获取区块列表分页
export function getblocks(pageIndex, pageSize) {
    return request({
        url: `/v1/getBlockByPage`,
        method: "get",
        params: {
            pageIndex: pageIndex,
            pageSize: pageSize
        }
    });
}
// 根据获取代币转账记录分页
export function getTokensRecords(address, pageIndex, pageSize) {
    return request({
        url: `/v1/getTokensRecords`,
        method: "get",
        params: {
            address: address,
            pageIndex: pageIndex,
            pageSize: pageSize
        }
    });
}
// 根据获取代币转账记录分页
export function getTokenHolders(token) {
    return request({
        url: `/v1/getTokenHolders?token=${token}`,
        method: "get"
    });
}
// 根据代币地址查询总交易数
export function getTokenTransferCount(token) {
    return request({
        url: `/v1/getTokenTransferCount?token=${token}`,
        method: "get"
    });
}
// 根据代币地址查询交易总额
export function getTokenTransferAmount(token) {
    return request({
        url: `/v1/getTokenTransferAmount?token=${token}`,
        method: "get"
    });
}
// 最佳手续费
export function getMinerFee() {
    return request({
        url: `/v1/getMinerFee`,
        method: "get"
    });
}
// 销毁总数
export function getFeeTotal() {
    return request({
        url: `/v1/getFeeTotal`,
        method: "get"
    });
}
// 获取代币列表
export function getTokenList() {
    return request({
        url: `/v1/getTokenList`,
        method: "get"
    });
}
// 获取余额
export function getBalance(address) {
    return request({
        url: `/v1/getBalance`,
        method: "get",
        params:{
            address:address,
        }
    });
}

